local addon, ns = ...
local cfg = ns.cfg
local playerClass = select(2, UnitClass("player"))	

if cfg.usetextart == true then
-- bar 1
if cfg.bars == true then
	local bar = CreateFrame("Frame",nil,UIParent)
	bar:SetFrameStrata("BACKGROUND")
	bar:SetFrameLevel(3)	
	bar:SetWidth(cfg.barwidth)
	bar:SetHeight(cfg.barheight)
	bar:SetPoint("BOTTOM", cfg.bar1x, cfg.bar1y)
	bar:Show()
	bar:SetScale(cfg.panelscale)
	local bar2 = bar:CreateTexture(nil,"BACKGROUND")
	bar2:SetTexture(cfg.tex)
	bar2:SetAllPoints(bar)	
	bar2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	bar2:SetAlpha(1)
	
	bar.Glow = CreateFrame("Frame", nil, bar)
	bar.Glow:SetPoint("TOPLEFT", bar, "TOPLEFT", -4, 4)
	bar.Glow:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", 4, -4)
	bar.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	bar.Glow:SetBackdropColor(0, 0, 0, 0.8)
	bar.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	bar.Glow:SetFrameLevel(20)	

-- bar 2	
	local abar = CreateFrame("Frame",nil,UIParent)
	abar:SetFrameStrata("BACKGROUND")
	abar:SetFrameLevel(3)	
	abar:SetWidth(cfg.barwidth)
	abar:SetHeight(cfg.barheight)
	abar:SetPoint("BOTTOM", cfg.bar2x, cfg.bar2y)
	abar:Show()
	abar:SetScale(cfg.panelscale)
	local abar2 = abar:CreateTexture(nil,"BACKGROUND")
	abar2:SetTexture(cfg.tex)
	abar2:SetAllPoints(abar)	
	abar2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	abar2:SetAlpha(1)
	
	abar.Glow = CreateFrame("Frame", nil, abar)
	abar.Glow:SetPoint("TOPLEFT", abar, "TOPLEFT", -4, 4)
	abar.Glow:SetPoint("BOTTOMRIGHT", abar, "BOTTOMRIGHT", 4, -4)
	abar.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	abar.Glow:SetBackdropColor(0, 0, 0, 0.8)
	abar.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	abar.Glow:SetFrameLevel(20)	
end	
	
	-- info
	if cfg.useinfobar == true then
	local ibar = CreateFrame("Frame",nil,UIParent)
	ibar:SetFrameStrata("BACKGROUND")
	ibar:SetFrameLevel(3)	
	ibar:SetWidth(cfg.infobarw)
	ibar:SetHeight(cfg.infobarh)
	ibar:SetPoint("BOTTOMRIGHT", cfg.infobarx, cfg.infobary)
	ibar:Show()
	ibar:SetScale(cfg.panelscale)
	local ibar2 = ibar:CreateTexture(nil,"BACKGROUND")
	ibar2:SetTexture(cfg.tex)
	ibar2:SetAllPoints(ibar)	
	ibar2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	ibar2:SetAlpha(1)
	
	ibar.Glow = CreateFrame("Frame", nil, ibar)
	ibar.Glow:SetPoint("TOPLEFT", ibar, "TOPLEFT", -4, 4)
	ibar.Glow:SetPoint("BOTTOMRIGHT", ibar, "BOTTOMRIGHT", 4, -4)
	ibar.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	ibar.Glow:SetBackdropColor(0, 0, 0, 0.8)
	ibar.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	ibar.Glow:SetFrameLevel(20)	
	end
	
	-- chat
	if cfg.usechatbar == true then
	local cbar = CreateFrame("Frame",nil,UIParent)
	cbar:SetFrameStrata("BACKGROUND")
	cbar:SetFrameLevel(3)	
	cbar:SetWidth(cfg.chatbarw)
	cbar:SetHeight(cfg.chatbarh)
	cbar:SetPoint("BOTTOMLEFT", cfg.chatbarx, cfg.chatbary)
	cbar:Show()
	cbar:SetScale(cfg.panelscale)
	local cbar2 = cbar:CreateTexture(nil,"BACKGROUND")
	cbar2:SetTexture(cfg.tex)
	cbar2:SetAllPoints(cbar)	
	cbar2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	cbar2:SetAlpha(1)
	
	cbar.Glow = CreateFrame("Frame", nil, cbar)
	cbar.Glow:SetPoint("TOPLEFT", cbar, "TOPLEFT", -4, 4)
	cbar.Glow:SetPoint("BOTTOMRIGHT", cbar, "BOTTOMRIGHT", 4, -4)
	cbar.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	cbar.Glow:SetBackdropColor(0, 0, 0, 0.8)
	cbar.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	cbar.Glow:SetFrameLevel(20)		
	end
	
	-- minimap
	if cfg.usemini == true then
	local mbox = CreateFrame("Frame",nil,UIParent)
	mbox:SetFrameStrata("BACKGROUND")
	mbox:SetFrameLevel(3)	
	mbox:SetWidth(cfg.miniwidth)
	mbox:SetHeight(cfg.miniheight)
	mbox:SetPoint("TOPLEFT", cfg.mxpos, cfg.mypos)
	mbox:Show()
	mbox:SetScale(cfg.panelscale)
	local mbox2 = mbox:CreateTexture(nil,"BACKGROUND")
	mbox2:SetTexture(cfg.tex)
	mbox2:SetAllPoints(mbox)	
	mbox2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	mbox2:SetAlpha(1)
	
	mbox.Glow = CreateFrame("Frame", nil, mbox)
	mbox.Glow:SetPoint("TOPLEFT", mbox, "TOPLEFT", -4, 4)
	mbox.Glow:SetPoint("BOTTOMRIGHT", mbox, "BOTTOMRIGHT", 4, -4)
	mbox.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	mbox.Glow:SetBackdropColor(0, 0, 0, 0.8)
	mbox.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	mbox.Glow:SetFrameLevel(20)	
	end
	
	-- stance bar 
	if cfg.usestance == true then
	if playerClass == "DRUID" or playerClass == "WARRIOR" or playerClass == "PALADIN" or playerClass == "DEATHKNIGHT" or playerClass == "HUNTER" then
	local testb = CreateFrame("Frame",nil,UIParent)
	testb:SetFrameStrata("BACKGROUND")
	testb:SetFrameLevel(3)
	if playerClass == "WARRIOR" or playerClass == "DEATHKNIGHT" then	
	testb:SetWidth(cfg.sbarwidth-68)
	else
	testb:SetWidth(cfg.sbarwidth)
	end
	testb:SetHeight(cfg.sbarheight)
	testb:SetPoint("BOTTOM", cfg.sbxpos, cfg.sbypos)
	testb:Show()
	testb:SetScale(cfg.panelscale)
	local testb2 = testb:CreateTexture(nil,"BACKGROUND")
	testb2:SetTexture(cfg.tex)
	testb2:SetAllPoints(testb)	
	testb2:SetVertexColor(cfg.maincolor[1], cfg.maincolor[2], cfg.maincolor[3]) 	
	testb2:SetAlpha(1)
	
	testb.Glow = CreateFrame("Frame", nil, testb)
	testb.Glow:SetPoint("TOPLEFT", testb, "TOPLEFT", -3, 3)
	testb.Glow:SetPoint("BOTTOMRIGHT", testb, "BOTTOMRIGHT", 3, -3)
	testb.Glow:SetBackdrop{edgeFile = cfg.glowtex1, edgeSize = cfg.edgesize, insets = {left = cfg.insets, right = cfg.insets, top = cfg.insets, bottom = cfg.insets}}
	testb.Glow:SetBackdropColor(0, 0, 0, 0.8)
	testb.Glow:SetBackdropBorderColor(unpack(cfg.brdcolor))
	testb.Glow:SetFrameLevel(20)	
	end
	end	
end	